package com.wg.net.server.http;

import com.alibaba.fastjson.annotation.JSONField;

/**
 * HTTP请求抽象基类
 *
 * @author 少爷123
 */
public abstract class BaseHttpRequest implements IHttpRequest {

    @JSONField(serialize = false)
    protected final HttpServletRequest httpRequest;

    @JSONField(serialize = false)
    protected final HttpServletResponse response;

    @JSONField(serialize = false)
    protected String errorMessage;

    protected BaseHttpRequest(HttpServletRequest httpRequest, HttpServletResponse response) {
        this.httpRequest = httpRequest;
        this.response = response;
    }

    public HttpServletRequest getHttpRequest() {
        return httpRequest;
    }

    public HttpServletResponse getResponse() {
        return response;
    }

    public String getErrorMessage() {
        return errorMessage;
    }

    @Override
    public boolean parse() {
        return true;
    }
}
